package com.zgq.share.tools;

import com.zgq.share.thirdplatform.IPlatform;
import com.zgq.share.thirdplatform.PlatformFactory;
import com.zgq.share.thirdplatform.PlatformType;
import com.zgq.share.ui.R;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;

public class DialogTool {
	
	private Context context;
	
	public DialogTool(Context context) {
		this.context = context;
	}
	
	public void showLoginTipDialog(int title, int content) {
		
		AlertDialog.Builder builder = new Builder(context);

		builder.setTitle(context.getResources().getString(title));
		builder.setMessage(context.getResources().getString(content));
//		builder.setIcon(co);
		
		builder.setPositiveButton(context.getResources().getString(R.string.login),
				new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						PlatformType pt = PlatformType.SINA;
						IPlatform p = PlatformFactory.getPlatform(context, pt);
						p.authenticate();
					}
				});

		builder.setNegativeButton(context.getResources().getString(R.string.cancle),
				new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						dialog.dismiss();
					}
				}).show();
		
	}
	

}
